package com.ruoyi.mobile.project.ums.service;

import com.github.pagehelper.PageHelper;
import com.ruoyi.db.ums.domain.UmsUser;
import com.ruoyi.db.ums.mapper.UmsUserMapper;
import com.ruoyi.mobile.project.sms.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class WxUmsUserService
{
    @Autowired
    private UmsUserMapper userMapper;

    public UmsUser findById(Long userId)
    {
        return userMapper.selectUmsUserById(userId);
    }

    public UserVo findUserVoById(Long userId)
    {
        UmsUser user = findById(userId);
        UserVo userVo = new UserVo();
        userVo.setNickname(user.getNickname());
        userVo.setAvatar(user.getAvatar());
        return userVo;
    }

    public UmsUser queryByOid(String openId)
    {
        return userMapper.selectUmsUserByOpenId(openId);
    }

    public void add(UmsUser user)
    {
        userMapper.insertUmsUser(user);
    }

    public int updateById(UmsUser user)
    {
        return userMapper.updateUmsUser(user);
    }

    public List<UmsUser> querySelective(String username, String mobile, Integer page, Integer size, String sort, String order)
    {
        return null;
    }

    public int count()
    {
        return 0;
    }

    public List<UmsUser> queryByUsername(String username)
    {
        return null;
    }

    public boolean checkByUsername(String username)
    {
        return true;
    }

    public List<UmsUser> queryByMobile(String mobile)
    {
        return null;
    }

    public List<UmsUser> queryByOpenid(String openid)
    {
        return null;
    }

    public void deleteById(Long id)
    {
        userMapper.deleteUmsUserById(id);
    }
}
